<template>
  <el-row class="editInfo" justify="center" type="flex">
    <el-col :span="12">
      <el-form ref="form" :model="roles" label-width="80px">
        
        <el-form-item label="用户名">
          <el-input v-model="roles.username"></el-input>
        </el-form-item>
        <el-form-item label="邮箱">
          <el-input v-model="roles.email"></el-input>
        </el-form-item>

        <el-form-item label="简介">
          <el-input type="textarea" v-model="roles.intro"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="commit">立即修改</el-button>
          <el-button>取消</el-button>
        </el-form-item>
      </el-form>
    </el-col>
  </el-row>
</template>
<script>
import { mapGetters } from "vuex";

export default {
    methods:{
        commit(){
            this.$store.dispatch("updateInfo",this.roles).then(()=>{
                this.$router.go(-1)
            })
        },
        
      
    },
  computed: {
    ...mapGetters(["roles"]),
  },
};
</script>
<style>

</style>